import { viteMockServe } from 'vite-plugin-mock'

export function configMockPlugin({ isBuild }: { isBuild: boolean }) {
    return viteMockServe({
        ignore: /^_/,
        mockPath: 'mock',
        localEnabled: !isBuild,
        prodEnabled: isBuild,
        // 直接在main。tsx中调用，无需代理
        //     injectCode: `
        //       import { setupProdMockServer } from '../mock/_createProductionServer';
        //       setupProdMockServer();
        //       `,
    })
}